#ifndef IMAGE_PROCESS_H_
#define IMAGE_PROCESS_H_
#include <opencv2/opencv.hpp>

namespace autodrive {
namespace perception {

/// @brief crop and resize image ,and then do image operations
/// @param image image in
/// @param carea crop area
/// @param rsize resize size
void crop_resize(cv::Mat const& image, cv::Rect2i const& carea,
                 cv::Size2i const& rsize, cv::Mat& out) noexcept(false);

/// @brief bgr image to nv12
/// @param src yuv420 image
/// @param dst nv12 image
void bgr_to_nv12(cv::Mat const& src, cv::Mat& dst) noexcept(false);

/// @brief nv12 image to bgr image
/// @param y_addr y address
/// @param uv_addr uv address
/// @param size image size
/// @param img out bgr image
void nv12_to_bgr(char const* y_addr, char const* uv_addr,
                 cv::Size2i const& size, cv::Mat& img) noexcept(false);

}  // namespace perception
}  // namespace autodrive
#endif  // !IMAGE_PREPROCESSOR_H_
